package game.model.vo
{
	import game.model.config.CarVipLevelConfig;

	public class CarGamblerVo
	{
		public var uid:String;
		
		public var uname:String;
		
		private var _money:Number=0;
		
		private var _viplevelId:int = 0;
		
		private var _vipconfig:CarVipLevelConfig;
		/**用户输赢金额**/
		private var userWinMoney:Number=0;
		public function CarGamblerVo()
		{
		}
		public function get scoreMoney():Number
		{
			//var value:Number = money-startMoney;
			//if (isNaN(value)) return 0;
			return userWinMoney;
		}
		public function set scoreMoney(n:Number):void
		{
			userWinMoney+=n;
		}
		public function get money():Number
		{
			return _money;
		}

		public function set money(value:Number):void
		{
			_money = value;
		}

		public function get viplevelId():int
		{
			return _viplevelId;
		}

		public function set viplevelId(value:int):void
		{
			_viplevelId = value;
			//
			if (_viplevelId!=0) 
			{
				var list:Array = ZooMain.config.getConfigListByConfigValue(CarVipLevelConfig,"stationid",_viplevelId);
				if (list.length) 
				{
					var config:CarVipLevelConfig = list[0] as CarVipLevelConfig;
					_vipconfig = config;
				}
				else
				{
					_viplevelId = 0;
				}
			}
		}
			
		public function getVipName():String
		{
			if (_vipconfig) 
			{
				return _vipconfig.vipname;
			}
			return "";
		}
		
		public function getVipLevel():int
		{
			if (_vipconfig) 
			{
				return _vipconfig.id-1;
			}
			return 0;
		}
			

	}
}